package 题目集.二分;

import java.util.Scanner;

public class ch08_分巧克力 {
    static long[][] a;
    static int l,r;
    static int n,k;
    // x/k*y/k = 该巧克力能分的数量
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        k=sc.nextInt();
        a=new long[n][2];
        long sum=0;
        for(int i=0;i<n;i++){
            a[i][0]=sc.nextInt();
            a[i][1]=sc.nextInt();
            sum+=a[i][0]*a[i][1];
        }
        l=1;
        r= (int) Math.sqrt((double) sum /k);
        check(21);
        System.out.println(search());
    }
    public static int search(){
        while (l<=r){
            int m=l+r>>1;
            if(check(m)) {
                l = m + 1;
            }else {
                r = m - 1;
            }
        }
        if (check(l)) return l;
        return r;
    }
    public static boolean check(int m){
        long cnt=0;
        for(int i=0;i<n;i++){
            long cur = (a[i][0] / m) * (a[i][1] / m);    //要向下取整，所以要括号
            cnt+= cur;
        }
        return cnt>=k;
    }
}
